Open
Conversation
ioo5959
approved these changes
Jul 10, 2025
Contributor
There was a problem hiding this comment.
저도 첫번째 방법을 가장 먼저 생각했네요,,, 핵심은 저장 데이터?를 적게 만드는 것 같습니당 이 코드로 중복 검사를 set외에 dictonary를 이용하는 방법 있다는 걸 알게 되었습니다
Contributor
There was a problem hiding this comment.
저는 큐를 생각했는데, 생각해보니 결국 어차피 한 방향으로 꺼내기만 하는거라 스택이든 큐든 상관이 없네용
Contributor
Author
There was a problem hiding this comment.
네 스택 큐 둘다 안쓰고도 되더라구요
s13121312
approved these changes
Jul 10, 2025
Member
There was a problem hiding this comment.
뒤에다가 !를붙이는군요 스위프트에서는 신기하네요!
수고하셨습니다!
Contributor
Author
There was a problem hiding this comment.
딕셔너리는 키로 값을 찾을때 보통 null이 나올 수 있는 자료구조니깐 값을 꺼낼때 조심해야해요
근데 !는 안전하게 값을 꺼내는 방법이 아닌 강제로 꺼내는 방식인데,
앞에 코드에서 딕셔너리에 값을 직접 등록했기 때문에 해당 키 값이 반드시 존재한다고 확신하고 !를 썼습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. 롤케이크 자르기 - 구현
🔗 문제 링크
https://school.programmers.co.kr/learn/courses/30/lessons/132265
✔️ 소요된 시간
30분
✨ 수도 코드
1차 잘못된 구현
2차 개선
📚 새롭게 알게된 내용
2. 기능개발 - 스택
🔗 문제 링크
https://school.programmers.co.kr/learn/courses/30/lessons/42586
✔️ 소요된 시간
30분
✨ 수도 코드
📚 새롭게 알게된 내용